#pragma once

#include "includeBase.h"
#include "../common/BasePclModel.h"

class StatisticalOutlierRemovalModel : public BasePclModel
{
public:
    StatisticalOutlierRemovalModel();

public:
    static StatisticalOutlierRemovalModel& get();

public: // IJsonSerializable
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    QJsonObject toJson() const override;

public: // Property
    QString pcdFile() const { return pcdFile_; }
    void setPcdFile(const QString& pcdFile) { pcdFile_ = pcdFile; }

    int meanK() const { return meanK_; }
    void setMeanK(int meanK) { meanK_ = meanK; }

    double stddevMulThresh() const { return stddevMulThresh_; }
    void setStddevMulThresh(double stddevMulThresh)
    {
        stddevMulThresh_ = stddevMulThresh;
    }

    bool negative() const { return negative_; }
    void setNegative(bool negative) { negative_ = negative; }

private:
    QString pcdFile_ = "<pcl-data>/tutorials/table_scene_lms400.pcd";

    /**
     * @brief the number of nearest neighbors to use for mean distance
     * estimation
     */
    int meanK_ = 50;

    /**
     * @brief the standard deviation multiplier for the distance threshold
     * calculation
     */
    double stddevMulThresh_ = 0.1;

    bool negative_ = false;
};
